package xyz.bali16.module.netdisk.utils;

public final class CoreConst {


    /**字符常量映射*/

    /**
     * 数据权限过滤
     */
    public static final String SQL_FILTER = "sql_filter";
    /**
     * 当前页码
     */
    public static final String PAGE = "page";
    /**
     * 每页显示记录数
     */
    public static final String LIMIT = "limit";
    /**
     * 升序
     */
    public static final String ASC = "asc";
    /**
     * 排序字段
     */
    public static final String ORDER_FIELD = "sidx";
    /**
     * 排序方式
     */
    public static final String ORDER = "order";

    /**
     * 超级管理员code
     */
    public static final String SUPER_ADMIN = "SUPER_ADMIN";

    /**
     * 超级管理员code
     */
    public static final String SUPER_ADMIN_CN = "超级管理员";

    /**
     * 普通用户code
     */
    public static final String NORMAL_USER = "NORMAL_USER";

    /**
     * session中用户信息key
     */
    public static final String SESSION_USER_INFO = "loginUser";

    /**
     * 页面上保存配置的key
     */
    public static final String GLOBAL_CONFIG = "globalConfig";

    /**
     * url中sessionId的key
     */
    public static final String URL_TOKEN = "token";

    /**
     * 用户的默认初始密码
     */
    public static final String DEFAULT_PASSWORD = "12345678";

    public static final Integer PAGE_SIZE = 10;
    public static final Integer TOP_MENU_ID = 0;
    public static final String TOP_MENU_NAME = "顶层菜单";
    public static final String ADMIN_PREFIX = "admin/";
    public static final String NET_DISK_PREFIX = "netdisk/";
    public static final String THEME_PREFIX = "theme/";

    public static class Shiro {

        /**
         * cookie中保存sessionId的key
         */
        public static final String SHIRO_COOKIE = "shiro.cookie";
        /**
         * cookie中保存记住密码数据的key
         */
        public static final String SHIRO_REMEMBER_ME = "shiro.rememberMe";
        public static final String SHIRO_REDIS_SESSION_PREFIX = "pb_cms:session:";
        public static final String SHIRO_REDIS_CACHE_NAME = "shiro_pb_cms";



    }

    /**
     * 用户的状态
     */
    public static class Status {
        /**
         * 正常
         */
        public static final int AVAILABLE = 1;
        /**
         * 禁用
         */
        public static final int DISABLED = 0;

        public static int auto(Object o) {
            int stat = Status.DISABLED;
            if ("1".equals(String.valueOf(o))) {
                stat = Status.AVAILABLE;
            }
            return stat;
        }

    }

    public static class ReturnMessage {

        /**
         * 成功
         */
        public static final int SUCCEEDED = 200;
        /**
         * 失败
         */
        public static final int FAILED = 500;
        /**
         * 登录缺失
         */
        public static final int UNAUTHORIZED = 401;
        /**
         * 参数缺失
         */
        public static final int MISSING_PARAMS = 400;

        /**
         * 权限缺失
         */
        public static final int MISSING_PERMISSION = 403;

        /**
         * 资源缺失
         */
        public static final int NOT_FOUND = 404;
        /**
         * 资源冲突、资源已存在
         */
        public static final int CONFLICT = 409;

        /**
         * 默认返回消息
         ***/

        /**
         * 成功消息
         */
        public static final String SUCCEEDED_MSG = "成功请求";
        /**
         * 失败消息
         */
        public static final String FAILED_MSG = "失败请求";
        /**
         * 参数缺失消息
         */
        public static final String MISSING_PARAMS_MSG = "参数缺失";
        /**
         * 登录缺失
         */
        public static final String UNAUTHORIZED_MSG = "登录缺失";
        /**
         * 权限缺失消息
         */
        public static final String MISSING_PERMISSION_MSG = "权限缺失";
        /**
         * 资源缺失
         */
        public static final String NOT_FOUND_MSG = "资源缺失";
        /**
         * 资源冲突、资源已存在
         */
        public static final String CONFLICT_MSG = "资源已存在、冲突";
    }

    public static class OSS {
        /**
         * 文件存储服务类型
         * 1：七牛  2：阿里云  3：腾讯云  4：本地
         */
        public static final int UPLOAD_TYPE_QINIUYUN = 1;
        public static final int UPLOAD_TYPE_ALIYUN = 2;
        public static final int UPLOAD_TYPE_QCLOUD = 3;
        public static final int UPLOAD_TYPE_LOCAL = 4;
    }


}
